using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[System.Serializable]
public class Stat
{
    [SerializeField] private float baseValue;   

    public List<float> modifiers;       

    public void SetupDefaultValue(float _value)     
    {
        baseValue = _value;
    }

    public void AddModifier(float _modifier)    
    {
        modifiers.Add(_modifier);
    }

    public void RemoveModifier(float _modifier)     
    {
        modifiers.Remove(_modifier);
    }

    public float GetValue()     
    {
        float finalValue = baseValue;

        foreach (var modifier in modifiers)     
        {
            finalValue += modifier;
        }

        return finalValue;
    }
}
